package oop4;

/**
 * @author oldliu
 * @since 1.0
 */
//宠物医生
public class PetDoctor {
    private String name;
    public PetDoctor(String name){
        this.name=name;
    }

    //给人看病
    public void cure(People p){
        System.out.println(name+"在给"+p.getName()+"看病");
        System.out.println("请"+p.getName()+"描述一下哪里不舒服");
        System.out.println("吃药，康复了");
    }
    public void cure(Pet d){
        System.out.println(name+"在给"+d.getName()+"治病");
        d.print();
        //如果d是个老虎，把嘴捆上
        if(d instanceof Tiger){
            Tiger t= (Tiger) d;

            System.out.println("把"+d.getName()+"的嘴给捆上！");
        }
        if(d.getHealth()<50){
            System.out.println("打针，吃药，健康恢复了");
            d.setHealth(60);
        }else{
            System.out.println(d.getName()+"没病，走两步看看");
        }
    }

//    public void cure(Dog d){
//        System.out.println(name+"在给"+d.getName()+"治病");
//        if(d.getHealth()<50){
//            System.out.println("打针，吃药，健康恢复了");
//            d.setHealth(60);
//        }else{
//            System.out.println(d.getName()+"没病，走两步看看");
//        }
//    }
//    public void cure(Penguin d){
//        System.out.println(name+"在给"+d.getName()+"治病");
//        if(d.getHealth()<50){
//            System.out.println("打针，吃药，健康恢复了");
//            d.setHealth(60);
//        }else{
//            System.out.println(d.getName()+"没病，走两步看看");
//        }
//    }
//    public void cure(Tiger d){
//        System.out.println(name+"在给"+d.getName()+"治病");
//        if(d.getHealth()<50){
//            System.out.println("打针，吃药，健康恢复了");
//            d.setHealth(60);
//        }else{
//            System.out.println(d.getName()+"没病，走两步看看");
//        }
//    }
}
